package com.bao.work.jin.entity;

import java.math.BigDecimal;

/**
 * @author baoye
 * @date 2024-08-02/16:44
 */
public class Goods implements Comparable<Goods>{
    private String goodsId;
    private String goodsName;
    private BigDecimal price;
    private String color;
    private Integer size;

    public Goods() {
    }

    public Goods(String goodsId, String goodsName, BigDecimal price, String color, Integer size) {
        this.goodsId = goodsId;
        this.goodsName = goodsName;
        this.price = price;
        this.color = color;
        this.size = size;
    }



    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    @Override
    public String toString() {
        return goodsId+"\t\t"+goodsName+"\t\t"+price+"\t\t"+color+"\t\t"+size+"\t\t";
    }

    public String toString(String c,Integer num){
        return goodsId+c+goodsName+c+price+c+color+c+size+c+num+'\n';
    }

    @Override
    public int compareTo(Goods o) {

        return this.goodsId.compareTo(o.getGoodsId())!=0?this.price.compareTo(o.price):0;
    }
}
